﻿using System;
using System.Configuration;

namespace Infrastructure.ServicesManager.Configuration
{
    class ServicesCollectionElement : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new ServiceElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            if (!(element is ServiceElement)) throw new ArgumentException("Element is not of type ServiceElement");
            return (element as ServiceElement).Name;
        }
    }
}
